<?php

session_start();
$return = array();
if (isset($_POST['email']) && $_POST['email'] != ""
        && isset($_POST['wachtwoord']) && $_POST['wachtwoord'] != "") {
    $email = $_POST['email'];
    $wachtwoord = $_POST['wachtwoord'];

    $id = checkLogin($email, $wachtwoord);

    if ($id != NULL) {
        $return = array();
        $return['login'] = "succes";
        $return['user_id'] = $id;
        $_SESSION['login'] = true;
    } else {
        $return['login'] = "failed";
    }
} else {
    $return['login'] = "failed";
}
echo json_encode($return);

function checkLogin($email, $wachtwoord) {
    
}

?>
